package com.antler.smt.portal.controller;

import com.antler.smt.portal.annotation.OperateCut;
import com.antler.smt.response.base.Result;
import com.antler.smt.service.portal.RefundService;
import com.antler.smt.utils.LogUtil;
import com.antler.smt.validate.DataValidator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * 退款申请
 *
 * @author zhangyi
 * @date 2018-6-6 18:11:17
 */
@RestController
@RequestMapping(value = "/refund")
@Api(description = "退款申请")
public class RefundController {

    /**
     * 日志
     */
    private static Logger log = LogUtil.get();

    @Resource
    private RefundService refundService;

    /**
     * 申请退款
     *
     * @return
     */
    @PostMapping("/applyRefund/{orderId}")
    @ApiOperation(value = "获取区域列表", httpMethod = "POST")
    @OperateCut(operationContent = "申请退款")
    public Result refund(@PathVariable(value = "orderId") Long orderId) {
        Result result = null;

        DataValidator.isBlank(String.valueOf(orderId),"订单id不能为空！");
            result = refundService.applyRefund(orderId);
        return result;
    }
}
